/* GUI CONVERTED from rwwrrp.p (converter v1.75) Sat Aug 12 23:18:41 2000 */
/* rwwrrp.p - WORKCENTER ROUTING STANDARDS REPORT                       */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rwwrrp.p (converter v1.00) Fri Oct 10 13:57:20 1997 */
/* web tag in rwwrrp.p (converter v1.00) Mon Oct 06 14:17:46 1997 */
/*F0PN*/ /*K0ZQ*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 2.0      LAST MODIFIED: 02/08/88   BY: EMB */
/* REVISION: 4.0    LAST MODIFIED: 02/24/88    BY: WUG *A175**/
/* REVISION: 4.0    LAST MODIFIED: 07/18/88    BY: flm *A328**/
/* REVISION: 6.0    LAST MODIFIED: 03/06/90    BY: emb *D001**/
/* REVISION: 7.2    LAST MODIFIED: 08/28/94    BY: srk *FQ43**/
/* REVISION: 8.6    LAST MODIFIED: 10/15/97    BY: bvm *K0ZQ**/

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */
/*K0ZQ*/ /* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K0ZQ*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rwwrrp_p_1 "Sort by Work Center/Routing Code"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwwrrp_p_2 "Work Center/Routing Code"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

          define variable desc1   like pt_desc1.
          define variable desc2   like ro_desc.
          define variable wkctr   like wcr_wkctr.
          define variable wkctr1  like wcr_wkctr.
          define variable part    like wcr_part.
          define variable part1   like wcr_part.
/*D001*/  define variable sortby  like mfc_logical
                                  format {&rwwrrp_p_2}
                                  label {&rwwrrp_p_1}.

/*K0ZQ* *moved up*
 *         /* DISPLAY TITLE */
 *         {mfdtitle.i "b+ "}
 *K0ZQ*/

          
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
             
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
wkctr          colon 20
             wkctr1         label {t001.i} colon 45
             part           colon 20
             part1          label {t001.i} colon 45 skip (1)
/*FQ43*/     space(1)
             sortby
           SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



          /* SET EXTERNAL LABELS */
          setFrameLabels(frame a:handle).

/*K0ZQ*/ {wbrp01.i}


/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

   view frame a.
   if wkctr1 = hi_char then wkctr1 = "".
   if part1 = hi_char then part1 = "".

/*K0ZQ*/ if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0ZQ*/ {wbrp06.i &command = update &fields = "  wkctr wkctr1 part part1 sortby" &frm = "a"}

/*K0ZQ*/ if (c-application-mode <> 'web') or
/*K0ZQ*/ (c-application-mode = 'web' and
/*K0ZQ*/ (c-web-request begins 'data')) then do:

   bcdparm = "".
   {mfquoter.i wkctr  }
   {mfquoter.i wkctr1 }
   {mfquoter.i part   }
   {mfquoter.i part1  }
   {mfquoter.i sortby }

   if wkctr1 = "" then wkctr1 = hi_char.
   if part1 = "" then part1 = hi_char.

   status input.

   hide frame b.
   hide frame d.

/*K0ZQ*/ end.

   /* SELECT PRINTER */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



   {mfphead.i}

   if sortby then do:
      for each wcr_route where (wcr_wkctr >= wkctr and wcr_wkctr <=
      wkctr1)  and (wcr_part >= part and wcr_par <= part1)
      no-lock use-index wcr_route with frame b width 132 no-attr-space:
     find  wc_mstr   where wc_wkctr = wcr_wkctr  and wc_mch =
     wcr_mch no-lock no-error.
     /* SET EXTERNAL LABELS */
     setFrameLabels(frame b:handle).
     display wcr_wkctr  wcr_mch WITH STREAM-IO /*GUI*/ .
     if available wc_mstr then display wc_desc WITH STREAM-IO /*GUI*/ .
     find pt_mstr where pt_part = wcr_part no-lock no-error.
     find ro_det where ro_routing = wcr_part and ro_op = wcr_op
     no-lock no-error.
     display wcr_part WITH STREAM-IO /*GUI*/ .
     if available pt_mstr then display pt_desc1 WITH STREAM-IO /*GUI*/ .
     display wcr_op WITH STREAM-IO /*GUI*/ .
     if available ro_det then display ro_desc WITH STREAM-IO /*GUI*/ .
     display wcr_rate WITH STREAM-IO /*GUI*/ .
     if available pt_mstr and pt_desc2 <> "" then do:
       down 1.
       display pt_desc2 @ pt_desc1 WITH STREAM-IO /*GUI*/ .
     end.
     
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

      end.
   end.
   else do:
      for each wcr_route where (wcr_wkctr >= wkctr and wcr_wkctr <=
      wkctr1)  and (wcr_part >= part and wcr_par <= part1)
      no-lock use-index wcr_part  with frame d width 132 no-attr-space:
     find  wc_mstr   where wc_wkctr = wcr_wkctr  and wc_mch =
     wcr_mch no-lock no-error.
     /* SET EXTERNAL LABELS */
     setFrameLabels(frame d:handle).
     display wcr_wkctr  wcr_mch WITH STREAM-IO /*GUI*/ .
     if available wc_mstr then display wc_desc WITH STREAM-IO /*GUI*/ .
     find pt_mstr where pt_part = wcr_part no-lock no-error.
     find ro_det where ro_routing = wcr_part and ro_op = wcr_op
     no-lock no-error.
     display wcr_part WITH STREAM-IO /*GUI*/ .
     if available pt_mstr then display pt_desc1 WITH STREAM-IO /*GUI*/ .
     display wcr_op WITH STREAM-IO /*GUI*/ .
     if available ro_det then display ro_desc WITH STREAM-IO /*GUI*/ .
     display wcr_rate WITH STREAM-IO /*GUI*/ .
     if available pt_mstr and pt_desc2 <> "" then do:
       down 1.
       display pt_desc2 @ pt_desc1 WITH STREAM-IO /*GUI*/ .
     end.
    
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

      end.
   end.

   /* REPORT TRAILER */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

end.

/*K0ZQ*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" wkctr wkctr1 part part1 sortby "} /*Drive the Report*/
